if ( $attribute === 'id' ) {
global $wgEnforceHtmlIds;
$value = Sanitizer::escapeId( $value,
- $wgEnforceHtmlIds ? array() : 'xml' );
+ $wgEnforceHtmlIds ? 'noninitial' : 'xml' );
}
// If this attribute was previously set, override it.
$id = urlencode( Sanitizer::decodeCharReferences( strtr( $id, ' ', '_' ) ) );
$id = str_replace( array_keys( $replace ), array_values( $replace ), $id );
- /*
- // Let's not go changing our links just yet, since we plan to
- // rip this out anyway and switch to the prettier Unicode-friendly
- // links as XHTML and HTML 5 allow and browsers seem to think is
- // just a-ok to do.
- //
if ( !preg_match( '/^[a-zA-Z]/', $id )
&& !in_array( 'noninitial', $options ) ) {
// Initial character must be a letter!
$id = "x$id";
}
- */
return $id;
}
# one version of Opera 9.x. The W3C validator, for one, doesn't seem
# to care if they aren't encoded.
return Sanitizer::escapeId( $fragment,
- $wgEnforceHtmlIds ? array() : 'xml' );
+ $wgEnforceHtmlIds ? 'noninitial' : 'xml' );
}
#----------------------------------------------------------------------------
# Save headline for section edit hint before it's escaped
$headlineHint = $safeHeadline;
$safeHeadline = Sanitizer::escapeId( $safeHeadline,
- $wgEnforceHtmlIds ? array() : 'xml' );
+ $wgEnforceHtmlIds ? 'noninitial' : 'xml' );
# HTML names must be case-insensitively unique (bug 10721)
$arrayKey = strtolower( $safeHeadline );
# Strip out wikitext links(they break the anchor)
$text = $this->stripSectionName( $text );
return '#' . Sanitizer::escapeId( $text,
- $wgEnforceHtmlIds ? array() : 'xml' );
+ $wgEnforceHtmlIds ? 'noninitial' : 'xml' );
}
/**